package com.mioto.ld.module.device.service;

import com.github.pagehelper.PageInfo;
import com.mioto.ld.component.BasePager;
import com.mioto.ld.module.device.model.*;
import com.mioto.ld.module.device.model.app.AppDeviceListVO;
import com.mioto.ld.module.device.model.app.AppDeviceMainPageAddressVO;
import com.mioto.ld.module.device.model.app.AppDeviceMainPageCounterVO;
import com.mioto.ld.module.device.model.app.AppDeviceMainPageVO;

import java.util.Date;
import java.util.List;

/**
 * IDeviceService
 *
 * @author mioto
 * @date 2024-05-15 16:13:50
 */
public interface IDeviceService{

    /**
     * 根据条件查询列表
     * @param device
     * @return
     */
    List<Device> findList(Device device);

    /**
     * 根据列名和对应的值查询对象
     * @param column
     * @param value
     * @return
     */
    Device findByColumn(String column, Object value);

    /**
     * 新增对象
     * @param device
     * @return
     */
    int insert(Device device);

    /**
     * 修改对象
     * @param device
     * @return
     */
    int update(Device device);

    /**
     * 修改对象,忽略空值
     * @param device
     * @return
     */
    int updateIgnoreNull(Device device);

    /**
     * 根据列名和对应的值删除对象
     * @param column
     * @param value
     * @return
     */
    int deleteByColumn(String column, Object value);

    /**
     * 根据主键列表批量删除
     * @param ids
     * @return
     */
    int batchDelete(Integer[] ids);

    PageInfo<DevicePagerVO> findPager(DeviceSearchDTO device, BasePager basePager);

    String[] findSnsByProductId(Integer productId);

    String[] findSnsByDeviceIds(String deviceIds);

    int updateLineDateBySn(String sn, Date onlineDate,Date offlineDate);

    DeviceStatusStatisticVO statusStatistics(DeviceSearchDTO device);

    DeviceDetailVO findDetail(Integer deviceId);

    DeviceDetailAppVO findDetailToApp(Integer deviceId);

    List<AppDeviceMainPageVO> findAppMainData();

    AppDeviceMainPageCounterVO findAppMainDeviceData(Integer productId);

    List<AppDeviceListVO> findAppDeviceList(Integer[] deviceIds, int searchType);

    List<AppDeviceMainPageAddressVO> appUserDevices();

    Device updateOwnerUser(String deviceSn, Integer userId);
}